<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>殷健翔的个人广告</title>
		
		
		<div class="ad-container">
		  <img src="img/04776C5196D3443523B3B9287448102B.jpg" alt="Advertisement">
		  <img src="img/3EAF3E4E8CBE2ECC79A755BB4C37F8C7.jpg" alt="Advertisement">
		  <img src="img/E54C2F8327817D0EB21617B2DDE81E59.jpg" alt="Advertisement">
		</div>
         <style>.ad-container {
		  height: 30vh;
		  display: flex;
		  flex-direction: column;
		}
		
		.ad-container img {
		  width: 100%;
		  height: auto;
		}
</style>
<div class="left-ad ad">
  <img src="img/5BF083686563EFDED540294B7AE08385.jpg" alt="Left Advertisement">
</div>
<div class="right-ad ad">
  <img src="img/2D1C930812001DF696515F9DEA401259.jpg" alt="Right Advertisement">
</div>

<style>
	
	.ad {
	  position: fixed;
	  top: 50%;
	  width: 200px;
	  height: 200px;
	  margin-top: -100px;
	  display: flex;
	  justify-content: center;
	  align-items: center;
	  padding: 10px;
	}
	
	.left-ad {
	  left: 0;
	}
	
	.right-ad {
	  right: 0;
	}
	
	.ad img {
	  width: 100%;
	  height: auto;
	}
	
	.close-btn {
	  position: absolute;
	  top: 0;
	  right: 0;
	  cursor: pointer;
	}

	
</style>
		<script>$(document).ready(function() {
  // 获取浏览器信息
  let isIE = false;
  let ua = window.navigator.userAgent;
  let msie = ua.indexOf("MSIE ");
  let trident = ua.indexOf("Trident/");
  if (msie > 0 || trident > 0) {
      isIE = true;
  }
  
  // 控制广告的显示和隐藏
  function showAds() {
    $(".ad").show();
  }

  function hideAds() {
    $(".ad").hide();
  }

  // 控制关闭按钮的显示和隐藏
  function showCloseBtn() {
    $(".close-btn").show();
  }

  function hideCloseBtn() {
    $(".close-btn").hide();
  }

  // 控制广告的滚动
  function scrollAds() {
    let scrollTop = $(window).scrollTop();
    let adTop = $(".ad").offset().top;
    let adHeight = $(".ad").outerHeight();

    // 滚动到显示广告的位置
    if (scrollTop >= adTop && scrollTop <= adTop + adHeight - $(window).height()) {
      showAds();
    } else {
      hideAds();
    }
  }

  // 控制广告的关闭
  $(".close-btn").click(function() {
    hideAds();
  });

  // 初始化
  if (!isIE) {
    showAds();
    showCloseBtn();
  }

  // 监听滚动事件
  $(window).scroll(function() {
    if (!isIE) {
      scrollAds();
    }
  });
});
</script>
<div class="popup-ad">
  <img src="img/14CF892A3307772B1600BCE0C7CCB5C6.jpg" alt="Popup Advertisement">
  <div class="close-btn">&times;</div>
</div>
<style>
	.popup-ad {
	  position: fixed;
	  bottom: -300px;
	  right: 20px;
	  width: 300px;
	  height: auto;
	  background-color: #ffffff;
	  border: 1px solid #cccccc;
	  z-index: 9999;
	  animation: popup-ad 1s ease forwards;
	}
	
	.popup-ad img {
	  width: 100%;
	  height: auto;
	}
	
	.close-btn {
	  position: absolute;
	  top: -20px;
	  right: -20px;
	  width: 40px;
	  height: 40px;
	  line-height: 40px;
	  text-align: center;
	  font-size: 24px;
	  font-weight: bold;
	  background-color: #ffffff;
	  border: 1px solid #cccccc;
	  cursor: pointer;
	}
	
	@keyframes popup-ad {
	  0% {
	    bottom: -300px;
	  }
	  100% {
	    bottom: 20px;
	  }
	}

</style>
		<script>$(document).ready(function() {

  function showPopup() {
    $(".popup-ad").show();
  }

  function hidePopup() {
    $(".popup-ad").hide();
  }

  $(".close-btn").click(function() {
    hidePopup();
  });
  
  // 设计动画效果
  setTimeout(function() {
    showPopup();
  }, 5000);
});
</script>
	</head>
	<body>
	</body>
</html>